<script setup lang="ts">
import { ref } from 'vue'
import { currency_list, handleGetCurrency, handleSetCurrency } from '@/plugins/currency.plugin'
const currency = ref('USD')
currency.value = handleGetCurrency()

const handleGo = (key) => {
  currency.value = handleSetCurrency(key)
}
</script>

<template>
  <div>当前货币：{{ currency }}</div>
  <div>{{ currency_list[currency].name }}</div>
  <div>
    <div v-for="item,key in currency_list">
      {{ item.name }} （{{ item.alias }}{{ item.mark }}）<a href="javascript:;" @click="handleGo(key)">GO</a>
    </div>
  </div>
</template>